package abstractFactory;

import methodFactory.BJCheesePizza;
import methodFactory.BJPepperPizza;
import simpleFactory.Pizza;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: BJFactory
 * @author: xiayuanxing
 * @description: 北京工厂（子类）
 * @date: 2021/12/17 15:23
 * @version: 1.0
 */
public class BJFactory implements AbsFactory{


    public Pizza createPizza(String orderType) {
        System.out.println("使用的是抽象工厂模式");
        Pizza pizza = null;
        if (orderType.equals("cheese")){
            pizza = new BJCheesePizza();
        }else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
